

package Controlador;

import Dao.DaoCooperativa;
import Modelo.Cooperativa;
import Modelo.Listas;
import Vista.JFrameConsulCoop;
import java.sql.ResultSet;
import java.sql.SQLException;

public class ControladorConsulCoop 
{
    private JFrameConsulCoop formConCoop;

    public ControladorConsulCoop() throws SQLException 
    {
        formConCoop = new JFrameConsulCoop();
        formConCoop.setVisible(true);
        cargarGridCoop();  
    }
  //--------------------------------------  
    private void cargarGridCoop() throws SQLException
    {
       int fila=0;
       ResultSet registroCoop;
       DaoCooperativa daoCoop=new DaoCooperativa();
       
       registroCoop=daoCoop.ConsultarCooperativa();
       
       while (registroCoop.next())
        {            
            formConCoop.getjTableCoop().setValueAt(registroCoop.getString("rifc"), fila, 0);
            formConCoop.getjTableCoop().setValueAt(registroCoop.getString("nombrec"), fila, 1);
            formConCoop.getjTableCoop().setValueAt(registroCoop.getString("telefonoc"), fila, 2);
            formConCoop.getjTableCoop().setValueAt(registroCoop.getString("impuestoc"), fila, 3);
            formConCoop.getjTableCoop().setValueAt(registroCoop.getString("seguroc"), fila, 4);
            
            fila++;
            
        }
    }
}
